<!DOCTYPE html>
<html>
    <head>
    <meta charset="utf-8">
    <title>vue html demo</title>
    <script src="./lib/vue-2.4.0.js"></script>
    </head>
    <body>
        <div id="app">


            <!-- 分析 -->
            <!-- 监听文本框数据的改变  -->
            <input type="text" v-model="firstname" @keyup="getFullname">+
            <input type="text" v-model="lastname" @keyup="getFullname">=
            <input type="text" v-model="fullname">
        </div>
        <script>
            var vm = new Vue({
                el: '#app',
                data: {
                    firstname: '',
                    lastname: '',
                    fullname: '',
                },
                methods:{
                    getFullname() {
                        this.fullname = this.firstname + '-' +this.lastname
                    }
                }
            })
        </script>
    </body>
</html>